//-----------------------------------------------------------------------------
// Name: Systems.cpp
// Auth: Bradford J. Smith
// Desc: provides a central location for access, intialization and shutdown of 
//	any game systems
//-----------------------------------------------------------------------------

#include "Systems.h"

#include "Assert.h"
#include "DisplayManager.h"
#include "InputManager.h"
#include "TuningParser.h"

//-----------------------------------------------------------------------------
// Globals for Systems:
//-----------------------------------------------------------------------------
cDisplayManager gDisplayManager;
cBlockMap gBlockMap;
cTuningParser gGeneralTuning;
cInputManager gInputManager;

//-----------------------------------------------------------------------------
// Systems Management:
//-----------------------------------------------------------------------------
void InitSystems()
{
	// initialize any data in systems in a way that lets us control order.
	gDisplayManager.Init();
	gBlockMap.Init();

	cTuningParser::eParseReturn parseReturn = gGeneralTuning.ParseFile("Tutorial6Tuning.txt");
	Assert(parseReturn == cTuningParser::kParseSuccess);
}

void ShutdownSystems()
{
	gDisplayManager.Shutdown();

	// give any systems an opportunity to clean up that need it.
	gBlockMap.Shutdown();
}

//-----------------------------------------------------------------------------
// Accessors:
//-----------------------------------------------------------------------------
cDisplayManager* GetDisplayManager()
{
	return &gDisplayManager;
}


cBlockMap* GetBlockMap()
{
	return &gBlockMap;
}

cTuningParser* GetGeneralTuning()
{
	return &gGeneralTuning;
}

cInputManager* GetInputManager()
{
	return &gInputManager;
}
